package cn.tedu.sprig.jdbc;

import com.alibaba.druid.pool.DruidDataSource;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TestJdbc {
    @Test
    public void demo01(){
        DruidDataSource source = new DruidDataSource();
        source.setUrl("jdbc://musql://localhost:3306//xxx");
        source.setUsername("root");
        source.setPassword("root");
        source.setDriverClassName("com.mysql....");
    }

    @Test
    public void demo02(){
        ApplicationContext context = new ClassPathXmlApplicationContext("dean-jdbc.xml");
        DruidDataSource source = context.getBean("source",DruidDataSource.class);
        System.out.println(source.getUrl());
    }
}
